3.2.43 \(\int \frac {\sqrt {a+a \sec (e+f x)}}{c+c \sec (e+f x)} \, dx\) [143]

Optimal. Leaf size=91 \[ \frac {2 \sqrt {a} \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{c f}-\frac {\sqrt {2} \sqrt {a} \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{c f} \]

[Out]

2*arctan(a^(1/2)*tan(f*x+e)/(a+a*sec(f*x+e))^(1/2))*a^(1/2)/c/f-arctan(1/2*a^(1/2)*tan(f*x+e)*2^(1/2)/(a+a*sec
(f*x+e))^(1/2))*2^(1/2)*a^(1/2)/c/f

________________________________________________________________________________________

Rubi [A]
time = 0.06, antiderivative size = 91, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.185, Rules used = {21, 3861, 3859, 209, 3880} \begin {gather*} \frac {2 \sqrt {a} \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a \sec (e+f x)+a}}\right )}{c f}-\frac {\sqrt {2} \sqrt {a} \text {ArcTan}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a \sec (e+f x)+a}}\right )}{c f} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sqrt[a + a*Sec[e + f*x]]/(c + c*Sec[e + f*x]),x]

[Out]

(2*Sqrt[a]*ArcTan[(Sqrt[a]*Tan[e + f*x])/Sqrt[a + a*Sec[e + f*x]]])/(c*f) - (Sqrt[2]*Sqrt[a]*ArcTan[(Sqrt[a]*T
an[e + f*x])/(Sqrt[2]*Sqrt[a + a*Sec[e + f*x]])])/(c*f)

Rule 21

Int[(u_.)*((a_) + (b_.)*(v_))^(m_.)*((c_) + (d_.)*(v_))^(n_.), x_Symbol] :> Dist[(b/d)^m, Int[u*(c + d*v)^(m +
 n), x], x] /; FreeQ[{a, b, c, d, n}, x] && EqQ[b*c - a*d, 0] && IntegerQ[m] && ( !IntegerQ[n] || SimplerQ[c +
 d*x, a + b*x])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 3859

Int[Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[-2*(b/d), Subst[Int[1/(a + x^2), x], x, b*(C
ot[c + d*x]/Sqrt[a + b*Csc[c + d*x]])], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 3861

Int[1/Sqrt[csc[(c_.) + (d_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[1/a, Int[Sqrt[a + b*Csc[c + d*x]], x], x]
- Dist[b/a, Int[Csc[c + d*x]/Sqrt[a + b*Csc[c + d*x]], x], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 3880

Int[csc[(e_.) + (f_.)*(x_)]/Sqrt[csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)], x_Symbol] :> Dist[-2/f, Subst[Int[1/(2
*a + x^2), x], x, b*(Cot[e + f*x]/Sqrt[a + b*Csc[e + f*x]])], x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0
]

Rubi steps

\begin {align*} \int \frac {\sqrt {a+a \sec (e+f x)}}{c+c \sec (e+f x)} \, dx &=\frac {a \int \frac {1}{\sqrt {a+a \sec (e+f x)}} \, dx}{c}\\ &=\frac {\int \sqrt {a+a \sec (e+f x)} \, dx}{c}-\frac {a \int \frac {\sec (e+f x)}{\sqrt {a+a \sec (e+f x)}} \, dx}{c}\\ &=-\frac {(2 a) \text {Subst}\left (\int \frac {1}{a+x^2} \, dx,x,-\frac {a \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{c f}+\frac {(2 a) \text {Subst}\left (\int \frac {1}{2 a+x^2} \, dx,x,-\frac {a \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{c f}\\ &=\frac {2 \sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {a+a \sec (e+f x)}}\right )}{c f}-\frac {\sqrt {2} \sqrt {a} \tan ^{-1}\left (\frac {\sqrt {a} \tan (e+f x)}{\sqrt {2} \sqrt {a+a \sec (e+f x)}}\right )}{c f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C] Result contains complex when optimal does not.
time = 0.69, size = 133, normalized size = 1.46 \begin {gather*} -\frac {i \sqrt {1+e^{2 i (e+f x)}} \left (\sinh ^{-1}\left (e^{i (e+f x)}\right )-\sqrt {2} \tanh ^{-1}\left (\frac {-1+e^{i (e+f x)}}{\sqrt {2} \sqrt {1+e^{2 i (e+f x)}}}\right )-\tanh ^{-1}\left (\sqrt {1+e^{2 i (e+f x)}}\right )\right ) \sqrt {a (1+\sec (e+f x))}}{c \left (1+e^{i (e+f x)}\right ) f} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sqrt[a + a*Sec[e + f*x]]/(c + c*Sec[e + f*x]),x]

[Out]

((-I)*Sqrt[1 + E^((2*I)*(e + f*x))]*(ArcSinh[E^(I*(e + f*x))] - Sqrt[2]*ArcTanh[(-1 + E^(I*(e + f*x)))/(Sqrt[2
]*Sqrt[1 + E^((2*I)*(e + f*x))])] - ArcTanh[Sqrt[1 + E^((2*I)*(e + f*x))]])*Sqrt[a*(1 + Sec[e + f*x])])/(c*(1
+ E^(I*(e + f*x)))*f)

________________________________________________________________________________________

Maple [A]
time = 0.47, size = 141, normalized size = 1.55

method result size
default \(-\frac {\sqrt {\frac {a \left (\cos \left (f x +e \right )+1\right )}{\cos \left (f x +e \right )}}\, \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \left (\ln \left (\frac {\sin \left (f x +e \right ) \sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}-\cos \left (f x +e \right )+1}{\sin \left (f x +e \right )}\right )+\sqrt {2}\, \arctanh \left (\frac {\sqrt {-\frac {2 \cos \left (f x +e \right )}{\cos \left (f x +e \right )+1}}\, \sin \left (f x +e \right ) \sqrt {2}}{2 \cos \left (f x +e \right )}\right )\right )}{c f}\) \(141\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a+a*sec(f*x+e))^(1/2)/(c+c*sec(f*x+e)),x,method=_RETURNVERBOSE)

[Out]

-1/c/f*(a*(cos(f*x+e)+1)/cos(f*x+e))^(1/2)*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*(ln((sin(f*x+e)*(-2*cos(f*x+e)
/(cos(f*x+e)+1))^(1/2)-cos(f*x+e)+1)/sin(f*x+e))+2^(1/2)*arctanh(1/2*(-2*cos(f*x+e)/(cos(f*x+e)+1))^(1/2)*sin(
f*x+e)/cos(f*x+e)*2^(1/2)))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(f*x+e))^(1/2)/(c+c*sec(f*x+e)),x, algorithm="maxima")

[Out]

integrate(sqrt(a*sec(f*x + e) + a)/(c*sec(f*x + e) + c), x)

________________________________________________________________________________________

Fricas [A]
time = 2.78, size = 316, normalized size = 3.47 \begin {gather*} \left [\frac {\sqrt {2} \sqrt {-a} \log \left (\frac {2 \, \sqrt {2} \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + 3 \, a \cos \left (f x + e\right )^{2} + 2 \, a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right )^{2} + 2 \, \cos \left (f x + e\right ) + 1}\right ) + 2 \, \sqrt {-a} \log \left (\frac {2 \, a \cos \left (f x + e\right )^{2} - 2 \, \sqrt {-a} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right ) \sin \left (f x + e\right ) + a \cos \left (f x + e\right ) - a}{\cos \left (f x + e\right ) + 1}\right )}{2 \, c f}, \frac {\sqrt {2} \sqrt {a} \arctan \left (\frac {\sqrt {2} \sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right ) - 2 \, \sqrt {a} \arctan \left (\frac {\sqrt {\frac {a \cos \left (f x + e\right ) + a}{\cos \left (f x + e\right )}} \cos \left (f x + e\right )}{\sqrt {a} \sin \left (f x + e\right )}\right )}{c f}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(f*x+e))^(1/2)/(c+c*sec(f*x+e)),x, algorithm="fricas")

[Out]

[1/2*(sqrt(2)*sqrt(-a)*log((2*sqrt(2)*sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)*sin(f*x +
e) + 3*a*cos(f*x + e)^2 + 2*a*cos(f*x + e) - a)/(cos(f*x + e)^2 + 2*cos(f*x + e) + 1)) + 2*sqrt(-a)*log((2*a*c
os(f*x + e)^2 - 2*sqrt(-a)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)*sin(f*x + e) + a*cos(f*x + e)
- a)/(cos(f*x + e) + 1)))/(c*f), (sqrt(2)*sqrt(a)*arctan(sqrt(2)*sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f
*x + e)/(sqrt(a)*sin(f*x + e))) - 2*sqrt(a)*arctan(sqrt((a*cos(f*x + e) + a)/cos(f*x + e))*cos(f*x + e)/(sqrt(
a)*sin(f*x + e))))/(c*f)]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {\sqrt {a \sec {\left (e + f x \right )} + a}}{\sec {\left (e + f x \right )} + 1}\, dx}{c} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(f*x+e))**(1/2)/(c+c*sec(f*x+e)),x)

[Out]

Integral(sqrt(a*sec(e + f*x) + a)/(sec(e + f*x) + 1), x)/c

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 189 vs. \(2 (76) = 152\).
time = 1.10, size = 189, normalized size = 2.08 \begin {gather*} -\frac {\sqrt {2} {\left (\frac {\sqrt {2} \sqrt {-a} a \log \left (\frac {{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2} - 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}{{\left | 2 \, {\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2} + 4 \, \sqrt {2} {\left | a \right |} - 6 \, a \right |}}\right )}{c {\left | a \right |}} + \frac {\sqrt {-a} \log \left ({\left (\sqrt {-a} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - \sqrt {-a \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + a}\right )}^{2}\right )}{c}\right )} \mathrm {sgn}\left (\cos \left (f x + e\right )\right )}{2 \, f} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((a+a*sec(f*x+e))^(1/2)/(c+c*sec(f*x+e)),x, algorithm="giac")

[Out]

-1/2*sqrt(2)*(sqrt(2)*sqrt(-a)*a*log(abs(2*(sqrt(-a)*tan(1/2*f*x + 1/2*e) - sqrt(-a*tan(1/2*f*x + 1/2*e)^2 + a
))^2 - 4*sqrt(2)*abs(a) - 6*a)/abs(2*(sqrt(-a)*tan(1/2*f*x + 1/2*e) - sqrt(-a*tan(1/2*f*x + 1/2*e)^2 + a))^2 +
 4*sqrt(2)*abs(a) - 6*a))/(c*abs(a)) + sqrt(-a)*log((sqrt(-a)*tan(1/2*f*x + 1/2*e) - sqrt(-a*tan(1/2*f*x + 1/2
*e)^2 + a))^2)/c)*sgn(cos(f*x + e))/f

________________________________________________________________________________________

Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\sqrt {a+\frac {a}{\cos \left (e+f\,x\right )}}}{c+\frac {c}{\cos \left (e+f\,x\right )}} \,d x \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + a/cos(e + f*x))^(1/2)/(c + c/cos(e + f*x)),x)

[Out]

int((a + a/cos(e + f*x))^(1/2)/(c + c/cos(e + f*x)), x)

________________________________________________________________________________________